package zut.wework.entity.meeting;

import com.tencentcloudapi.wemeet.models.meeting.MeetingInfo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import zut.wework.utils.MeetingUtil;

import java.util.List;

/**
 * @Classname: QueryMeetingVo
 * @Description: 回传给前端的显示信息
 * @Date: 2022/5/17
 * @Created: by ifaxcaeles
 */
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
public class QueryMeetingVo {
    String meetingId;
    String meetingCode;
    String subject;
    String joinUrl;
    String startTime;
    String endTime;

    public QueryMeetingVo(List<MeetingInfo> meetingInfoList) {
        for (MeetingInfo meetingInfo : meetingInfoList) {
            this.meetingId = meetingInfo.getMeetingId();
            this.meetingCode = meetingInfo.getMeetingCode();
            this.joinUrl = meetingInfo.getJoinUrl();
            this.subject = meetingInfo.getSubject();
            this.startTime = MeetingUtil.StampPhaseStr(meetingInfo.getStartTime());
            this.endTime = MeetingUtil.StampPhaseStr(meetingInfo.getEndTime());
        }
    }
}
